#06/10/2012 Tai-Hsien Ou Yang

FILE_LOCATION   =	"/ifs/scratch/c2b2/ip_lab/to2232/"
FILE_INPUT_PED 	=	"Soapv2.fam"
FILE_OUTPUT	=	"parchild.lst"


setwd(FILE_LOCATION)
dataset.ped<-scan(FILE_INPUT_PED , list(fid=0,id="",pr="",mt="", sex=0, note=0))
  
#	Take out only what we want

pairlist<-c()
pair1<-c()
pair2<-c()

    for(j in 1:(length(dataset.ped)))
    {
	
	pair1=cbind(dataset.ped$id[j],dataset.ped$pr[j]) 
	pair2=cbind(dataset.ped$id[j],dataset.ped$mt[j]) 
	pairlist<-rbind(pairlist,pair1)
	pairlist<-rbind(pairlist,pair2)
	
	}
	
write.table(pairlist, FILE_OUTPUT, row.names=F,col.names=F,append=F)

